import request from "./request";


export function getPostApi(params: any) {
    return request({
        url: '/posts/search/',
        method: 'get',
        params
    })
}

export function getMyPostsApi( ) {
    return request({
        url: '/posts/myposts',
        method: 'get'
    })
}

export function getMyFavoritesApi( ) {
    return request({
        url: '/posts/myfavorites',
        method: 'get'
    })
}


export function addPostApi(data: any) {
    return request({
        url: '/posts',
        method: 'post',
        data
    })
}
export function favoritesPostApi(id: any) {
    return request({
        url: '/posts/favorites/'+id,
        method: 'post',
    })
}
export function likePostApi(id: any) {
    return request({
        url: '/posts/like/'+id,
        method: 'post',
    })
}


